load("@build_bazel_rules_android//android:rules.bzl", "android_library")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

java_library(
    name = "prf_based_deriver_key_manager",
    srcs = ["PrfBasedDeriverKeyManager.java"],
    deps = [
        ":key_deriver",
        ":prf_based_key_derivation_key_proto_serialization",
        ":prf_based_key_deriver",
        "//proto:prf_based_deriver_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:key_manager",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_parameters",
        "//src/main/java/com/google/crypto/tink/prf:prf_key",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)

android_library(
    name = "prf_based_deriver_key_manager-android",
    srcs = ["PrfBasedDeriverKeyManager.java"],
    deps = [
        ":key_deriver-android",
        ":prf_based_key_derivation_key_proto_serialization-android",
        ":prf_based_key_deriver-android",
        "//proto:prf_based_deriver_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink:key_manager-android",
        "//src/main/java/com/google/crypto/tink:parameters-android",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor-android",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization-android",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_parameters-android",
        "//src/main/java/com/google/crypto/tink/prf:prf_key-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_protobuf_protobuf_javalite",
    ],
)

android_library(
    name = "prf_based_key_derivation_key_proto_serialization-android",
    srcs = ["PrfBasedKeyDerivationKeyProtoSerialization.java"],
    deps = [
        "//proto:prf_based_deriver_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink:parameters-android",
        "//src/main/java/com/google/crypto/tink:secret_key_access-android",
        "//src/main/java/com/google/crypto/tink:tink_proto_parameters_format-android",
        "//src/main/java/com/google/crypto/tink/internal:key_parser-android",
        "//src/main/java/com/google/crypto/tink/internal:key_serializer-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:parameters_parser-android",
        "//src/main/java/com/google/crypto/tink/internal:parameters_serializer-android",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization-android",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization-android",
        "//src/main/java/com/google/crypto/tink/internal:util-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_parameters-android",
        "//src/main/java/com/google/crypto/tink/prf:prf_key-android",
        "//src/main/java/com/google/crypto/tink/prf:prf_parameters-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_protobuf_protobuf_javalite",
    ],
)

java_library(
    name = "prf_based_key_derivation_key_proto_serialization",
    srcs = ["PrfBasedKeyDerivationKeyProtoSerialization.java"],
    deps = [
        "//proto:prf_based_deriver_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink:secret_key_access",
        "//src/main/java/com/google/crypto/tink:tink_proto_parameters_format",
        "//src/main/java/com/google/crypto/tink/internal:key_parser",
        "//src/main/java/com/google/crypto/tink/internal:key_serializer",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:parameters_parser",
        "//src/main/java/com/google/crypto/tink/internal:parameters_serializer",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_parameters",
        "//src/main/java/com/google/crypto/tink/prf:prf_key",
        "//src/main/java/com/google/crypto/tink/prf:prf_parameters",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)

java_library(
    name = "key_deriver",
    srcs = ["KeyDeriver.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:key",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "prf_based_key_deriver",
    srcs = ["PrfBasedKeyDeriver.java"],
    deps = [
        ":key_deriver",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_derivation_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key",
        "//src/main/java/com/google/crypto/tink/subtle/prf:streaming_prf",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "key_deriver-android",
    srcs = ["KeyDeriver.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:key-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "prf_based_key_deriver-android",
    srcs = ["PrfBasedKeyDeriver.java"],
    deps = [
        ":key_deriver-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_derivation_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:prf_based_key_derivation_key-android",
        "//src/main/java/com/google/crypto/tink/subtle/prf:streaming_prf-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "keyset_deriver_wrapper-android",
    srcs = ["KeysetDeriverWrapper.java"],
    deps = [
        ":key_deriver-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper-android",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set-android",
        "//src/main/java/com/google/crypto/tink/keyderivation:keyset_deriver-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "keyset_deriver_wrapper",
    srcs = ["KeysetDeriverWrapper.java"],
    deps = [
        ":key_deriver",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set",
        "//src/main/java/com/google/crypto/tink/keyderivation:keyset_deriver",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)
